package co.edu.javeriana.aes.oms.ordenes;

import co.edu.javeriana.touresbalon.oms.entities.Orders;
import co.edu.javeriana.touresbalon.oms.enumerations.OrderProcessState;
import co.edu.javeriana.touresbalon.oms.enumerations.OrderState;
import co.edu.javeriana.touresbalon.oms.services.OrdersBeanLocal;
import java.io.Serializable;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author Alejandro
 */
@ManagedBean
@SessionScoped
public class OrdenesController implements Serializable {

    @EJB
    private OrdersBeanLocal ordenes;
    List<Orders> findOrdersByStateAndProcessState;
    
    public OrdenesController() {
    }
    
    public void cargarOrdenes_validacion(){
        findOrdersByStateAndProcessState = ordenes.findOrdersByStateAndProcessState(OrderState.EN_VALIDACION.name(), OrderProcessState.OK.name());
    }
    
    public void cargarOrdenes_cerradas(){
        findOrdersByStateAndProcessState = ordenes.findOrdersByStateAndProcessState(OrderState.CERRADA.name(), OrderProcessState.OK.name());
    }
    
    public void cargarOrdenes_reservacion(){
        findOrdersByStateAndProcessState = ordenes.findOrdersByStateAndProcessState(OrderState.EN_RESERVACION.name(), OrderProcessState.OK.name());
    }

    public List<Orders> getFindOrdersByStateAndProcessState() {
        return findOrdersByStateAndProcessState;
    }

    public void setFindOrdersByStateAndProcessState(List<Orders> findOrdersByStateAndProcessState) {
        this.findOrdersByStateAndProcessState = findOrdersByStateAndProcessState;
    }
}
